<template>
    <div>
     <van-tabs>
    <van-tab v-for="(item,indexs) in tiemArr"
    :key="indexs"
     :title="item">
    <my-purchase :myPurchase="item"></my-purchase>
  </van-tab>
</van-tabs>
    </div>
</template>
<script>
import myPurchase from"../purchasePiao/lieBiaoTime.vue";
export default {
    components:{
        myPurchase
    },
    data(){
        return{
             active: 2,
              idd:null,
            shuju:null,
            tiemArr:[],
        }
    },
    methods:{
      async qingQiu(a,b,c){
          let re = await this.axios.get(`https://apis.netstart.cn/maoyan/movie/select/cinemas?limit=20&offset=0&client=iphone&channelId=4&showDate=${a}&movieId=${b}&sort=distance&cityId=${c}`)
            console.log(re.data.data.cinemas);
        },
        //获取15天的日期
        fun_date(num) { 
    let date1 = new Date();
    //今天时间
    let time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate()
    // console.log(time1);
    let date2 = new Date(date1);
     date2.setDate(date1.getDate() + num);
     //num是正数表示之后的时间，num负数表示之前的时间，0表示今天
     let time2 = date2.getFullYear() + "-" + (  (date2.getMonth() +  1) >9?(date2.getMonth() +  1):"0" +(date2.getMonth() +  1) )  + "-" +  (date2.getDate()>9?date2.getDate():"0"+date2.getDate());  

    // console.log(time2);
    return time2;
    }

    },
    created(){
          console.log(this.fun_date(6));
       for(let i =0; i<8;i++){
           this.tiemArr.push(this.fun_date(i))
            
       }
    //    console.log(this.tiemArr,"time");
    //    this.qingQiu(2022-3-8,this.$route.params.id,this.$store.state.myctsid)
        // console.log(this.$route.params.id,"id");


        // this.tiemArr.forEach(item=>{
        //     this.qingQiu(item,this.$route.params.id,this.$store.state.myctsid)
        //     console.log(item);
        //      console.log();
        // })

    }
}
</script>